package com.platform.system.entity;

import com.baomidou.mybatisplus.annotation.*;
import com.platform.common.bean.BaseEntity;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import javax.persistence.Column;
import javax.persistence.Id;
import javax.validation.constraints.NotBlank;

/**
 * describe:角色对象组实体类
 *
 * @author rainly
 * @date 2020/01/09
 * @time 4:23 下午
 */
@ApiModel(value = "角色对象组", description = "角色对象组SysRolegroup")
@Data
@TableName(value = "sys_role_group")
public class SysRoleGroup extends BaseEntity<SysRoleGroup> {

    @ApiModelProperty(value = "角色组id", name = "grole_id", example = "32位uuid", required = true)
    @Id
    @Column(name = "role_group_id", length = 32, columnDefinition = "varchar(32) COMMENT '主键'")
    @TableId(type = IdType.ASSIGN_ID)
    private String roleGroupId;

    @ApiModelProperty(value = "角色组名称", name = "role_group_name", example = "角色组名称", required = true)
    @Column(name = "role_group_name", length = 100, columnDefinition = "varchar(50) COMMENT '角色名称'")
    @NotBlank(message = "角色名称不能为空")
    private String roleGroupName;

    @ApiModelProperty(value = "角色组描述", name = "info", example = "描述角色组等", required = true)
    @Column(name = "info", length = 100, columnDefinition = "varchar(100) COMMENT '角色描述'")
    private String info;

    @ApiModelProperty(value = "角色组父id", name = "parent_id", example = "角色组父id", required = true)
    @Column(name = "parent_id", length = 32, columnDefinition = "varchar(32) COMMENT '角色组父id'")
    @NotBlank(message = "角色组父id不能为空")
    private String parentId;

    @ApiModelProperty(value = "角色组父id集合", name = "parent_ids", example = "角色组父id集合", required = true)
    @Column(name = "parent_ids", length = 500, columnDefinition = "varchar(500) COMMENT '角色组父id集合'")
    private String parentIds;

    @ApiModelProperty(value = "标记", name = "flag", example = "标记(diabale 删除 unable 正常)", required = true)
    @Column(name = "flag", length = 10, columnDefinition = "varchar(10) COMMENT '标记(diabale 删除 unable 正常)'")
    @TableField(fill = FieldFill.INSERT)
    private String flag;
}
